home *** CD-ROM | disk | FTP | other *** search
- %!
- %%Creator: PrintFile version 2.1.4
- %%LanguageLevel: 2
- %%EndComments
- %%BeginProlog
- %
- % PrintFile PostScript n-up printing procedure set
- % Copyright 1997-2000 Peter Lerup
- %
- % Author: Peter Lerup
- % Date: 00-07-27
-
- /PrFileDict 50 dict def
-
- PrFileDict begin
-
- /saveCnt 0 def
- /gsaveCnt 0 def
- /currMatrix matrix currentmatrix def
-
- /logPageNo 0 def
-
- /min { 2 copy gt { exch } if pop } def
- /xdef { exch def } def
-
- /initCS
- {
- currMatrix setmatrix
- initclip newpath 0 0 moveto pageWidth 0 rlineto 0 pageHeight rlineto
- pageWidth neg 0 rlineto closepath clip newpath
- } def
-
- /__restore
- {
- PrFileDict begin
- logPageNo [ currMatrix {} forall 9 -1 roll
- end
- restore
- PrFileDict begin
- ] /currMatrix xdef
- /logPageNo xdef
- initCS
- end
- } bind def
-
- /__grestore
- {
- grestore PrFileDict begin initCS end
- } bind def
-
- /setup {
- /frameWidth xdef
- /drawFrame xdef
- /advHor xdef
- /landscape xdef
- /nHeight xdef
- /nWidth xdef
- /ygutter xdef
- /xgutter xdef
- /bottomMarg xdef
- /topMarg xdef
- /rightMarg xdef
- /leftMarg xdef
-
- currentpagedevice /PageSize get {} forall
- /pageHeight xdef
- /pageWidth xdef
-
- /drawWidth pageWidth leftMarg sub rightMarg sub def
- /drawHeight pageHeight topMarg sub bottomMarg sub def
-
- landscape
- { drawWidth drawHeight /drawWidth xdef /drawHeight xdef }
- if
-
- /logPageWidth drawWidth xgutter nWidth 1 sub mul sub nWidth div def
- /logPageHeight drawHeight ygutter nHeight 1 sub mul sub nHeight div def
-
- /scaleFact
- logPageWidth pageWidth div
- logPageHeight pageHeight div
- min def
-
- /xOffset logPageWidth scaleFact pageWidth mul sub 2 div def
- /yOffset logPageHeight scaleFact pageHeight mul sub 2 div def
-
- systemdict /setpagedevice known
- {
- <</BeginPage PrFileDict /BeginPage get
- /EndPage PrFileDict /EndPage get>> setpagedevice
- }
- if
-
- } def
-
- /BeginPage {
- PrFileDict begin
- pop
- landscape { pageWidth 0 translate 90 rotate } if
- landscape {rightMarg} {leftMarg} ifelse
- logPageNo advHor {nWidth mod} {nHeight idiv} ifelse
- logPageWidth xgutter add mul add
- landscape {topMarg} {bottomMarg} ifelse
- nHeight 1 sub logPageNo advHor {nWidth idiv} {nHeight mod} ifelse
- sub logPageHeight ygutter add mul add
- translate
-
- /logPageNo logPageNo 1 add nWidth nHeight mul mod def
-
- xOffset yOffset translate
- scaleFact dup scale
- /currMatrix matrix currentmatrix def
- /saveCnt 0 def
- /gsaveCnt 0 def
- initCS
- end
- } def
-
- /alldone false def
-
- /EndPage {
- 2 eq
- { pop false }
- {
- pop
- PrFileDict begin
- alldone
- { logPageNo 1 ne nWidth nHeight mul 1 ne and }
- {
- drawFrame
- {
- initgraphics initclip
- frameWidth setlinewidth newpath
- 1 scaleFact div dup scale
- xOffset neg yOffset neg translate
- 0 0 moveto logPageWidth 0 rlineto
- 0 logPageHeight rlineto logPageWidth neg 0 rlineto
- 0 logPageHeight neg rlineto closepath
- stroke
- }
- if
-
- logPageNo 0 eq
- }
- ifelse
- end
- }
- ifelse
- } def
-
- /close {
- /alldone true def showpage
- } def
-
- end
-
- /save { PrFileDict begin /saveCnt saveCnt 1 add def end save } bind def
- /restore { PrFileDict /saveCnt get 0 gt { restore } { PrFileDict /__restore get exec } ifelse } bind def
- /gsave { PrFileDict begin /gsaveCnt gsaveCnt 1 add def end gsave } bind def
- /grestore { PrFileDict /gsaveCnt get 0 gt { grestore } { PrFileDict /__grestore get exec } ifelse } bind def
- /initgraphics { initgraphics PrFileDict begin initCS end } bind def
- /initmatrix { PrFileDict begin currMatrix end setmatrix } bind def
-
- %%EndProlog
-
-